UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'es0tCWE6jDL7WRfQ19vgvI3j6wrmSat8jhWjGe0wXMc='
WHERE
key_id = '68801cca51277a14776ecbb328cd01893dc6283da9f808c4286069338fa568ee'
AND (
token = 'es0tCWE6jDL7WRfQ19vgvI3j6wrmSat8jhWjGe0wXMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)