UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uq8f2sYoS3i532imvQKI3NF/m/Korg+yddZwkDtQV94='
WHERE
key_id = 'c8127cd0aa1032777db61ac1fdd69b1414628deaf2ce859ba693685606e779b9'
AND (
token = 'uq8f2sYoS3i532imvQKI3NF/m/Korg+yddZwkDtQV94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)