UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EZgDLC3b/QPhMUwCX6/4LBw5/pSDNyCfJ9okkKyShpA='
WHERE
key_id = 'd40a78bde93c34da53a72e5554a031604625fc72da9b655661654f52945ddb36'
AND (
token = 'EZgDLC3b/QPhMUwCX6/4LBw5/pSDNyCfJ9okkKyShpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)