UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+TJMkfc2JDQclFJ2vG9cTvU/pC8poLo0M0yk6SfzTT4=' 
WHERE 
  key_id = 'ca11c9755a763cc33c42a99b3df7b7ae5c267dae8faf7a6fbb8918826803ad57' 
  AND (
    token = '+TJMkfc2JDQclFJ2vG9cTvU/pC8poLo0M0yk6SfzTT4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044