UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LAZ3ms44RFlKvSJfqsBbxJS0GABHjrZ6r+N1OC6OtTQ=' 
WHERE 
  key_id = '218aa62495068228fbdb6031615563b7fa068d5c5dc804c335dcd8c9f8f98a57' 
  AND (
    token = 'LAZ3ms44RFlKvSJfqsBbxJS0GABHjrZ6r+N1OC6OtTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031