UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jlJnlbqv6O+Ku7aMrzwBGj/fbNHavU7G3bxzFsBXQHE=' 
WHERE 
  key_id = '3d1db1820868a5db2d64afd685b8b83b6b4b55fb4f2d95fbc428db69e53b08ca' 
  AND (
    token = 'jlJnlbqv6O+Ku7aMrzwBGj/fbNHavU7G3bxzFsBXQHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039