UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jU7C6zRQMHTpvmQfU8fzlW1dOGpNOcC1ku4VjFzrVEw='
WHERE
key_id = '4c3f531628d7272ec27742e006a835def0734c02023f2ada074b240cabe54ec9'
AND (
token = 'jU7C6zRQMHTpvmQfU8fzlW1dOGpNOcC1ku4VjFzrVEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)