UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kCFSWcGuCyAf48GX0cloWoRD7jR7di+Gg49F5qWTANY='
WHERE
key_id = '9af5c0d00c07bb422443caf79cc86ed7333d0168d67607a5f950faf89afc8656'
AND (
token = 'kCFSWcGuCyAf48GX0cloWoRD7jR7di+Gg49F5qWTANY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)