UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OM1ltGSF9c1tBtPlnoBzQhHkIDTW4BAsfdkfJYZGqOY=' 
WHERE 
  key_id = 'b98aaa33a55798f61a6764489a60d092af317800b6bd3deee196e63efe377437' 
  AND (
    token = 'OM1ltGSF9c1tBtPlnoBzQhHkIDTW4BAsfdkfJYZGqOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031