UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '20URquXNk+qBzpDD2jSt+BktHitiSMdFuhGAmCzUz18=' 
WHERE 
  key_id = '55ce5292b1eebe22df6ea38f584674b724bf4b1ec8fedda848afcbe29db0504d' 
  AND (
    token = '20URquXNk+qBzpDD2jSt+BktHitiSMdFuhGAmCzUz18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049