UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PztAwC/pjq4GaovbNGymKHO8xbe/Y8NLiheC4eFFTeQ=' 
WHERE 
  key_id = 'e389656661c4808f6df8ba0f1b8eaf5e51d8fb4dda47523628288c4514a04bd8' 
  AND (
    token = 'PztAwC/pjq4GaovbNGymKHO8xbe/Y8NLiheC4eFFTeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031