UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'taMQ7nl4Tk1EzyzPifKTtXEi2pJbbk/1/qLJNV+pg4E=' 
WHERE 
  key_id = '6edaa8254817440e3121ca91465ce7a79d68f850953eeab2043d084f6c4405c6' 
  AND (
    token = 'taMQ7nl4Tk1EzyzPifKTtXEi2pJbbk/1/qLJNV+pg4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041