UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QXgBUDYOPDbKNn/e6EiFyLylSXLNiCHkCMmNhKDcQJo=' 
WHERE 
  key_id = 'ec3919712b31b7256d3d9dc8c7792a6af1c705e235ac975f593134b0382c262a' 
  AND (
    token = 'QXgBUDYOPDbKNn/e6EiFyLylSXLNiCHkCMmNhKDcQJo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036