UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eOpRfq+Do2JnVFtL7AxrXTVQv06wNV6TTIlCLP1EEW4=' 
WHERE 
  key_id = '851cdc1b6186d1873487257282e7623f4f494818b0b5e2cda7296964148d86dd' 
  AND (
    token = 'eOpRfq+Do2JnVFtL7AxrXTVQv06wNV6TTIlCLP1EEW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049