UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'biBu3I09EAcsQag5m+cmTF1iMLUu+inaZRbOc92e2Fs='
WHERE
key_id = 'dd5765749f3345c64727876a322f8427d1f82cff9740ca7c3643019d79a62b1c'
AND (
token = 'biBu3I09EAcsQag5m+cmTF1iMLUu+inaZRbOc92e2Fs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)