UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AxxxRvaveklKBD9pxmZWQOzMi/EUTpcE/+nJVJolQp4=' 
WHERE 
  key_id = '01459127bb0fe4991292000f41aa004fb5911bfb6d671b7abadeee8ca0900ac2' 
  AND (
    token = 'AxxxRvaveklKBD9pxmZWQOzMi/EUTpcE/+nJVJolQp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019