UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e+pL3e4nXlKWM58XBdbPsl2OKxExF1Lsesvc797G3MI=' 
WHERE 
  key_id = 'bbda751e4c5de83ef3b0177e605894ac479585103ce2dba1ac6f5dcafa6eb8a4' 
  AND (
    token = 'e+pL3e4nXlKWM58XBdbPsl2OKxExF1Lsesvc797G3MI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036