UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VgtHAF+mBmDgnvqn4AU32S57Wj7m5swVkIR8I9Vp+TE=' 
WHERE 
  key_id = '17f7a0271debe17e63abd5bce41a0ac190eae82dc53bb9fc77222cfb9cf32220' 
  AND (
    token = 'VgtHAF+mBmDgnvqn4AU32S57Wj7m5swVkIR8I9Vp+TE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022