UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R4K6YrVZpUyu/QhFmUsIA2O76AxljIbmNA7yHX5lQ9M=' 
WHERE 
  key_id = '78eeb50b9855adf9c3f5a3ddffc1eb3b224bd5e3507a59f6754005af4d4bda94' 
  AND (
    token = 'R4K6YrVZpUyu/QhFmUsIA2O76AxljIbmNA7yHX5lQ9M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040