UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7GckXn4sb/thZAs3z3pIzuRVysb3ktju9g/YXqtP0UI=' 
WHERE 
  key_id = 'a4ed66c705c2e93247e3d1cd417c76c0b02d8d75a6e7c86c37ec48aaeced1e1b' 
  AND (
    token = '7GckXn4sb/thZAs3z3pIzuRVysb3ktju9g/YXqtP0UI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019