UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qFG8KdekJD/XlMawUM6XEMV+fpGzvjHfjVc39IKqC6U='
WHERE
key_id = 'da58df31184e17ec3ac7c21ff5b02b2d72c77dbed281b9993e82bc85ae180ba5'
AND (
token = 'qFG8KdekJD/XlMawUM6XEMV+fpGzvjHfjVc39IKqC6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)