UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TlX3hKHk+65Et9rx4a6Jhg4fRDVOATNd0Pp8ZFY9t58=' 
WHERE 
  key_id = '4b0900b0e29ea91946d1c8afbbf6e798621d89d053a2707de0f3f5fe6b5adec7' 
  AND (
    token = 'TlX3hKHk+65Et9rx4a6Jhg4fRDVOATNd0Pp8ZFY9t58=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032