UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I8HBnp3OVUfTR/IBRR0O6oS97Sf+F54mPKw81r0DC3c=' 
WHERE 
  key_id = 'cbdcd0ecf70e15a4ca28bc25e0562a49ef3c01b26ad76c345670d48b182b49d9' 
  AND (
    token = 'I8HBnp3OVUfTR/IBRR0O6oS97Sf+F54mPKw81r0DC3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035