UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hGYlk4mIrnTAeFmsaURvocr95Qe4nYGtdB+SBC3WUH8=' 
WHERE 
  key_id = 'e766943dfd58afab130b75ab14c8ecfe337d8db79ee2b54dc38bc72bce16c557' 
  AND (
    token = 'hGYlk4mIrnTAeFmsaURvocr95Qe4nYGtdB+SBC3WUH8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049