UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ctoqitrKerJQsYxHDaWQIA8skW4hNO/iHspdB1ISZhM='
WHERE
key_id = 'a897766a8ed1a665882d30145a11aeec66d610a44c86a34beeae0aaa068b2be6'
AND (
token = 'ctoqitrKerJQsYxHDaWQIA8skW4hNO/iHspdB1ISZhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)