UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EyItqDcoUAVLLWzhYMJO5M59NNxDGXBAeKJiXGRAbKY=' 
WHERE 
  key_id = '5a32fa4df2a062eecda704af859f9428f7909542f9fff21f766edca7d94b1f76' 
  AND (
    token = 'EyItqDcoUAVLLWzhYMJO5M59NNxDGXBAeKJiXGRAbKY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031