UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kikcTNKmahbjXT+Kqhc9MrV07sChtQaHyQrFBJicB6g='
WHERE
key_id = '64aaf2ba8d02e130b1152e78f11e0f456c6dff6ebf978cb95d1e16726f282cd3'
AND (
token = 'kikcTNKmahbjXT+Kqhc9MrV07sChtQaHyQrFBJicB6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)